package com.yinhai.message.filter;


import com.yinhai.core.common.api.config.impl.SysConfig;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;

public class CustomContextPathRequest extends HttpServletRequestWrapper {

    public CustomContextPathRequest(HttpServletRequest httpServletRequest) {
        super(httpServletRequest);
    }

    @Override
    public String getContextPath() {
        String contextpath = "";
        try {
            contextpath = SysConfig.getSysConfig("contextpath");
        } catch (Exception e) {
            e.printStackTrace();
        }
        if("".equals(contextpath) || contextpath == null) {
            return this.getContextPath();
        }
        return contextpath;
    }


}
